<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%String path = request.getContextPath();%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>小贷回购账单明细表 管理</title>
    <style type="text/css">
    </style>
    <jsp:include page="../../import.jsp" flush="true"/>
</head>

<body class="iframeBody">
<div class="Wrapper">
    <div class="fieldset1 tabel_col tabel_col_s clearFix">
        <div class="sqPanel">
            <div class="sqPanel_head inL">
                <span>回购账单主信息</span>
            </div>
            <div class="sqPanel_body">
            <div class="fieldBox col_33">
                <div class="label">客户名称</div>
                <div class="field">
                    ${mcrBillMVO.cstNm}
                </div>
            </div>
            <div class="fieldBox col_33">
                <div class="label">贷款合同号</div>
                <div class="field">
                    ${mcrBillMVO.crCntNo}
                </div>
            </div>
            <div class="fieldBox col_33">
                <div class="label">放款金额</div>
                <div class="field">
                    ${mcrBillMVO.crAmt}
                </div>
            </div>
            <div class="fieldBox col_33">
                <div class="label">放款时间</div>
                <div class="field">
                    ${mcrBillMVO.crDtString}
                </div>
            </div>


            <div class="fieldBox col_33">
                <div class="label">贷款日利率(%)</div>
                <div class="field">
                    ${mcrBillMVO.crRatePct}
                </div>
            </div>


            <div class="fieldBox col_33">
                <div class="label">是否结清</div>
                <div class="field">
                    ${mcrBillMVO.settle}
                </div>
            </div>
            </div>
        </div>
        <div class="sqPanel">
            <div class="sqPanel_head inL">
                <span>账单明细信息</span>
            </div>
            <div class="sqPanel_body">
                <div id="billDGrid" class="sq-grid"></div>
            </div>
        </div>
    </div>
</div>

<script type="text/javascript">
    var grid = null;
    $(function () {
        grid = $("#billDGrid").ligerGrid({
            url: '<%=path%>/mcr/mcrBillMRe/billDReInitList.do?billId=${billId}',
            method: 'get',
            columns: [
                {display: '期次', name: 'payPd', minWidth: 80, align: 'center', },
                {display: '还款时间', name: 'payDt', minWidth: 100, align: 'center', render:renderDate},
                {display: '应还本金', name: 'capAmt', minWidth: 100, align: 'right',
                    render:function(rowdata,index,value){
                        if(rowdata.capAmt){
                            return '&yen;'+FormatMoney(rowdata.capAmt/100);
                        }
                    }
                },
                {display: '应还利息', name: 'intrAmt', minWidth: 100, align: 'right',
                    render:function(rowdata,index,value){
                        if(rowdata.intrAmt){
                            return '&yen;'+FormatMoney(rowdata.intrAmt/100);
                        }
                    }
                },
                {display: '逾期罚息', name: 'oveAmt', minWidth: 100, align: 'right',
                    render:function(rowdata,index,value){
                        if(rowdata.oveAmt){
                            return '&yen;'+FormatMoney(rowdata.oveAmt/100);
                        }
                    }
                },
                {display: '实还本金', name: 'paidCapAmt', minWidth: 100, align: 'right',
                    render:function(rowdata,index,value){
                        if(rowdata.paidCapAmt){
                            return '&yen;'+FormatMoney(rowdata.paidCapAmt/100);
                        }
                    }
                },
                {display: '实还利息', name: 'paidIntrAmt', minWidth: 100, align: 'right',
                    render:function(rowdata,index,value){
                        if(rowdata.paidIntrAmt){
                            return '&yen;'+FormatMoney(rowdata.paidIntrAmt/100);
                        }
                    }
                },
                {display: '实还罚息', name: 'paidOveAmt', minWidth: 100, align: 'right',
                    render:function(rowdata,index,value){
                        if(rowdata.paidOveAmt){
                            return '&yen;'+FormatMoney(rowdata.paidOveAmt/100);
                        }
                    }
                },

            ],
            usePager: false,
            root: 'rows',
            record: 'total',
            hideLoadButton: true,
            width: '100%',
            height: '450',
            heightDiff: -2,
            checkbox: false,
            rownumbers: true,
            allowUnSelectRow: true,
            alternatingRow: false
        });
        grid.setHeight(100);

        $("#pageloading").hide();

    });

    //格式化时间
    function renderDate(rowdata, index, value) {
        var dateStr = "";
        if (null != value) {
            var date = new Date(value);
            dateStr = DateUtils.formatDate(date, DateUtils.YYYY_MM_DD);
        }
        return dateStr;
    }
</script>

</body>
</html>
